/*
 * @Author: yuanweijiang
 * @Date: 2024-12-12 14:16:00
 * @LastEditors: yuanweijiang
 */
import request from '/@/utils/request';

export const getDataSourceConfig = (data: any) => {
	return request({
		url: '/sys/data-source-configs',
		method: 'get',
		params: data,
	});
};
export const getApiGroup = (data: any) => {
	return request({
		url: '/sys/api-groups',
		method: 'get',
		params: data,
	});
};
export const getApi = (data: any) => {
	return request({
		url: '/sys/api-configs',
		method: 'get',
		params: data,
	});
};

export const deleteApi = (id: any) => {
	return request({
		url: `/sys/api-configs/${id}`,
		method: 'delete',
	});
};
export const changeApi = (data: any) => {
	return request({
		url: `/sys/api-configs/${id}`,
		method: 'put',
		data,
	});
};
export const getList = (data: any) => {
	return request({
		url: '/bussiness/datasource/list',
		method: 'post',
		data,
	});
};
export const addOrUpdateDataSource = (data: any) => {
	return request({
		url: '/bussiness/datasource/addOrUpdateDataSource',
		method: 'post',
		data,
	});
};
export const testConnection = (data: any) => {
	return request({
		url: '/bussiness/datasource/testConnection',
		method: 'post',
		data,
	});
};
export const updateStatus = (data: any) => {
	return request({
		url: '/bussiness/datasource/updateStatus',
		method: 'post',
		data,
	});
};
export const addBizServiceCatalog = (data: any) => {
	return request({
		url: '/bussiness/service/catalog/addBizServiceCatalog',
		method: 'post',
		data,
	});
};
export const getServiceCatalogTree = () => {
	return request({
		url: '/bussiness/service/catalog/getServiceCatalogTree',
		method: 'get',
	});
};

export const getServiceCatalogInfo = (data: any) => {
	return request({
		url: '/bussiness/service/catalog/getServiceCatalogInfo',
		method: 'post',
		data,
	});
};
export const updateServiceCatalog = (data: any) => {
	return request({
		url: '/bussiness/service/catalog/updateServiceCatalog',
		method: 'post',
		data,
	});
};
export const delServiceCatalog = (data: any) => {
	return request({
		url: '/bussiness/service/catalog/delServiceCatalog',
		method: 'post',
		data,
	});
};
export const getServiceManagementList = (data: any) => {
	return request({
		url: '/bussiness/service/Management/getServiceManagementList',
		method: 'post',
		data,
	});
};
export const updateServiceManagementData = (data: any) => {
	return request({
		url: '/bussiness/service/Management/modifyLabel',
		method: 'post',
		data,
	});
};
export const modifyAuthStatus = (data: any) => {
	return request({
		url: '/bussiness/service/Management/modifyAuthStatus',
		method: 'post',
		data,
	});
};
export const updateServiceStatus = (data: any) => {
	return request({
		url: '/bussiness/service/Management/updateServiceStatus',
		method: 'post',
		data,
	});
};
export const delServiceManagementData = (data: any) => {
	return request({
		url: '/bussiness/service/Management/delServiceManagementData',
		method: 'post',
		data,
	});
};
export const addServiceManagement = (data: any) => {
	return request({
		url: '/bussiness/service/Management/addServiceManagement',
		method: 'post',
		data,
	});
};
export const getServiceManagementData = (data: any) => {
	return request({
		url: '/bussiness/service/Management/getServiceManagementData',
		method: 'post',
		data,
	});
};
export const tableList = (id) => {
	return request({
		url: `/bussiness/datasource/tableList/${id}`,
		method: 'get',
	});
};
export const columnList = (data) => {
	return request({
		url: '/bussiness/datasource/columnList',
		method: 'get',
		params: data,
	});
};
export const executeQuery = (data) => {
	return request({
		url: '/bussiness/datasource/executeQuery',
		method: 'post',
		data,
	});
};
export const removeId = (data) => {
	return request({
		url: '/bussiness/datasource/remove',
		method: 'post',
		data,
	});
};
export const updateServiceManagement = (data) => {
	return request({
		url: '/bussiness/service/Management/updateServiceManagementData',
		method: 'post',
		data,
	});
};
